<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>异常订单列表</title>
    <link rel="shortcut icon" href="favicon.ico">
    <script src="../../res/js/comm.js?v=1.22.0"></script>
    <link href="../../res/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="../../res/plugins/select2/css/select2.min.css" rel="stylesheet">
    <script src="../../res/plugins/select2/js/select2.min.js"></script>
    <style> .select2-container--open {
        z-index: 10000000000
    }  </style>
    <style>
        .thridReturnApplCss {
            /*线性渐变语法：
            background-image:-webkit-gradient(type,x1 y1, x2 y2, from(开始颜色值),to(结束颜色值), [color-stop(偏移量小数,停靠颜色值),…] );
                type:line   -->表示渐变为线性
                x1,x2,y1,y2     -->渐变坐标，x1=x2垂直变换,y1=y2左右变换
            */
            background-image: -webkit-gradient(linear, left top, left bottom, from(#23c888), to(#23c888)); /*上下垂直渐变*/

            /*规定动画变换速度：ease-in-out -->动画以低速开始和结束 */
            -webkit-animation-timing-function: ease-in-out;

            /*为 @keyframes 动画规定一个名称*/
            -webkit-animation-name: thridReturnApplCss;

            /*完成一个动画所需时间*/
            -webkit-animation-duration: 200ms;

            /*规定动画播放次数：infinite为无限次*/
            -webkit-animation-iteration-count: infinite;

            /*规定动画播放方式：alternate为轮流反向播放*/
            -webkit-animation-direction: alternate;
        }

        @-webkit-keyframes thridReturnApplCss {
            0% {
                opacity: .4; /*元素不透明级别*/
                box-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
            }
            100% {
                opacity: 1;
                border: 1px solid rgba(59, 235, 235, 2);
                box-shadow: 0 1px 30px rgba(59, 255, 255, 2);
            }
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-info">
        <div class="panel-heading"><i class="fa fa-info-circle"></i> 异常订单列表</div>
        <div class="panel-body">
            <div class="ibox-query">
                <form id="queryForm" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">顶级渠道</label>
                        <!--<div class="col-sm-2" name="channelPluginsDiv"></div>-->
                        <div class="col-sm-2" name="channelSelectsPluginsDiv"></div>

                        <label class="col-sm-1 control-label">第三方订单号</label>
                        <div class="col-sm-2"><input name="outTradeCode" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">处理状态</label>
                        <div class="col-sm-2">
                            <select name="status" class="form-control" onchange="javascript:$.openx.query()">
                                <option value="">--请选择--</option>
                                <option value="PENDING">待处理</option>
                                <option value="FINISHED">已处理</option>
                            </select>
                        </div>
                        <label class="col-sm-1 control-label">收货人姓名</label>
                        <div class="col-sm-2"><input name="receiverName" class="form-control" type="text"></div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label">收货人电话</label>
                        <div class="col-sm-2"><input name="receiverPhone" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">下单开始时间</label>
                        <div class="col-sm-2"><input class="layui-input" id='startTime' name="startTime"
                                                     placeholder="下单开始时间" type="text" readonly></div>

                        <label class="col-sm-1 control-label">下单结束时间</label>
                        <div class="col-sm-2"><input class="layui-input" id='endTime' name="endTime"
                                                     placeholder="下单结束时间" type="text" readonly></div>
                        <div class="col-sm-2" style="text-align: right">
                            <button class="btn btn-info" onclick='$.openx.query()' type="button"><i
                                    class="glyphicon glyphicon-search"></i> 查询
                            </button>
                            &nbsp;
                            <button class="btn btn-info" onclick="resetForm()" type="button"><i
                                    class="glyphicon glyphicon-share-alt"></i> 重置
                            </button>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                </form>
            </div>
            <div class="row row-lg">
                <div class="col-sm-12">
                    <table id="table" data-show-export="true" style="overflow: hidden;white-space: nowrap;text-overflow:ellipsis;">
                        <thead>
                        <tr>
                            <th data-align="center" visible="false" data-field="id"
                                data-formatter="$.openx.generatorId"> 序号
                            </th>
                            <th data-align="center" data-formatter="showHandleFormat">操作</th>
                            <th data-align="center" data-field="outTradeCode" data-formatter="showDetail">第三方订单号</th>
                            <th data-align="center" data-field="topChannelCode" data-formatter="topChannelFormat">顶级渠道</th>
                            <th data-align="center" data-field="channelCode">渠道编号</th>
                            <th data-align="center" data-field="channelName">渠道名称</th>
                            <th data-align="center" data-field="receiverName">收货人名称</th>
                            <th data-align="center" data-field="reason" onclick="showAll()" data-formatter="formatReason">异常原因</th>
                            <th data-align="center" data-field="receiverPhone">收货人电话</th>
                            <th data-align="center" data-field="status" data-formatter="formatStatus">处理状态</th>
                            <th data-align="center" data-field="createTime" data-formatter='createTimeFormat'>下单时间</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>


<!-- 异常订单详情-->
<script type="text/html" id="orderDetailTpl">
    <div id="orderDetailDiv" style="padding: 15px">
        <table class="layui-table">
            <tbody>
            <tr>
                <td rowspan="4" class="layui-table-td-bg">基本信息:</td>
                <td class="layui-table-td-bg">渠道</td>
                <td class="text-center" width="150px"> {{d.channelName ? d.channelName :"" }}</td>
                <td class="layui-table-td-bg">第三方订单号</td>
                <td class="text-center">{{d.outTradeCode ? d.outTradeCode :"" }}</td>
                <td class="layui-table-td-bg">下单时间</td>
                <td class="text-center">{{d.createTime ? d.createTime:""}}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">商品总金额</td>
                <td class="text-center">{{d.goodsTotalAmount ? d.goodsTotalAmount : 0}}</td>
                <td class="layui-table-td-bg">优惠总金额</td>
                <td class="text-center">{{d.preferentialTotalAmount ? d.preferentialTotalAmount :0 }}</td>
                <td class="layui-table-td-bg">用户实付金额</td>
                <td class="text-center">{{d.customerNeedPayAmount ? d.customerNeedPayAmount :0 }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">配送费</td>
                <td class="text-center">{{d.deliveryAmount ? d.deliveryAmount :0}}</td>
                <td class="layui-table-td-bg">渠道编号</td>
                <td class="text-center">{{d.channelCode ? d.channelCode : ""}}</td>
                <td class="layui-table-td-bg">渠道名称</td>
                <td class="text-center">{{d.channelName ? d.channelName : ""}}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">收件人姓名</td>
                <td class="text-center">{{d.exceptionReceiver.receiverName?d.exceptionReceiver.receiverName:""}}</td>
                <td class="layui-table-td-bg">收件人电话</td>
                <td class="text-center">{{d.exceptionReceiver.receiverPhone?d.exceptionReceiver.receiverPhone:""}}</td>
                <td class="layui-table-td-bg">收件人地址</td>
                <td class="text-center">{{d.exceptionReceiver.address?d.exceptionReceiver.address.replace(/-/g, ""):""}}</td>
            </tr>
            <tr>
                <td rowspan="1" colspan="7" class="layui-table-td-bg">商品信息</td>
            </tr>
            <tr>
                <td colspan="7" style="padding: 4px;">
                    <table class="layui-table" style="text-align: center;margin: 0px">
                        <thead>
                        <tr>
                            <th style="text-align: center">商品编码</th>
                            <th style="text-align: center">商品名称</th>
                            <th style="text-align: center">执行价</th>
                            <th style="text-align: center">记账价</th>
                            <th style="text-align: center">数量</th>
                            <th style="text-align: center">记账价合计(元)</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{# layui.each(d.exceptionGoodses, function(index, item){ }}
                        <tr>
                            <td> {{item.goodsCode}}</td>
                            <td>{{item.goodsName}}</td>
                            <td>{{item.exercisePrice ? item.exercisePrice : 0}}</td>
                            <td>{{item.accountPrice ? item.accountPrice : 0}}</td>
                            <td>{{item.quantity ? item.quantity : 0}}</td>
                            <td>{{item.quantity ? Math.round(accMul(accMul(item.quantity , (item.accountPrice ?
                                item.accountPrice : 0)),100))/100 : 0}}
                            </td>
                        </tr>
                        {{# }); }}
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg">异常原因:</td>
                <td colspan="6">{{d.reason?d.reason:""}}</td>
            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg">备注:</td>
                <td colspan="6">{{d.remark?d.remark:""}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</script>

<!-- 异常订单处理-->
<script type="text/html" id="handleOrderTpl">
    <form class="form-horizontal" id="handleExceptionOrderForm" style="padding:10px;">
        <div id="handleExceptionOrderDiv" class="col-md-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">处理情况说明:</label>
                <div class="col-sm-9">
                    <textarea rows="5" name="remark" id="remark" class="form-control" type="text"></textarea>
                </div>
            </div>
        </div>
    </form>
</script>

<script src="../../res/plugins/yifeng/lbsAreaSelect.js"></script>

<script type="text/javascript">
    (function () {
        $.openx.loadScript(['../../res/plugins/yifeng/orderStatus.js', '../../res/plugins/iCheck/icheck.min.js', '../../res/plugins/yifeng/channelSelects.js', '../../js/order/exceptionOrder.js', '../../res/js/ajaxUtil.js']);
    })();
</script>
</html>